//
//  EFShoppingCartItem.m
//  EnjogFood
//
//  Created by 张文瀚 on 2017/5/1.
//  Copyright © 2017年 wf. All rights reserved.
//

#import "EFShoppingCartItem.h"
#import "EFShoppingCartCell.h"
#import "EFSepecialItem.h"

@implementation EFShoppingCartItem


-(instancetype)init
{
    self = [super init];
    if(self){
        self.viewClass = [EFShoppingCartCell class];
        self.viewHeight = 120.f;
    }
    return self;
}

-(EFSepecialItem *)castToSpecialItem{
    EFSepecialItem* specialItem = [[EFSepecialItem alloc]init];
    specialItem.productName = self.productName;
    specialItem.id = self.id;
    specialItem.price = self.price;
    specialItem.salePrice = self.salePrice;
    specialItem.img = self.img;
    specialItem.qty = self.qty;
     specialItem.type = self.type;
    return specialItem;
}

+(NSDictionary *)modelCustomPropertyMapper{
    return @{
             @"productId" :@"id"
             };
}

+(EFShoppingCartItem *)castFromProductItem:(EFSepecialItem *)pItem{
    EFShoppingCartItem *sItem = [[EFShoppingCartItem alloc] init];
    sItem.productName = pItem.productName;
    sItem.id = pItem.id;
    sItem.price = pItem.price;
    sItem.salePrice = pItem.salePrice;
    sItem.img = pItem.img;
    sItem.qty = pItem.qty;
    sItem.type = pItem.type;
    return sItem;
}
@end
